home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / mail / netmail_13.lha / NetMail / Drivers / Dme.editor < prev    next >
Text File  |  1995-10-14  |  2KB  |  66 lines

  1. /*
  2. ** $VER: Ed.editor 1.1 (11.8.95)
  3. ** Copyright (c) 1995 Roger Cassatella
  4. **
  5. */
  6.  
  7. OPTIONS RESULTS
  8. OPTIONS FAILAT 21
  9.  
  10. cmd = 'sys:utilities/dme'
  11. IF ~EXISTS(cmd) THEN DO
  12.    cmd = GetVar('NetMail/DmeCmd')
  13.    IF cmd = 0 | ~EXISTS(cmd) THEN DO
  14.       ADDRESS COMMAND 'SetEnv NetMail/DmeCmd `Which "Dme"`'
  15.       cmd = GetVar('NetMail/DmeCmd')
  16.       IF cmd = 0 THEN DO
  17.          ADDRESS COMMAND 'SetEnv NetMail/DmeCmd `RequestFile Title "Select Dme command" Noicons`'
  18.          cmd = GetVar('NetMail/DmeCmd')
  19.          IF cmd = 0 | ~EXISTS(cmd) THEN RETURN 2
  20.          ADDRESS COMMAND 'Copy QUIET ENV:NetMail/DmeCmd ENVARC:NetMail/DmeCmd'
  21.       END
  22.    END
  23. END
  24.  
  25. SELECT
  26.    WHEN UPPER(ARG(1)) = 'EDIT' THEN DO
  27.       PARSE ARG , file, port
  28.  
  29.       winpar  = ''
  30.       wininfo = GetVar('NetMail/EditorWin')
  31.       IF wininfo ~= 0 THEN DO
  32.          PARSE VAR wininfo pL pT pW pH .
  33.          winpar = 'WINDOW="CON:'pL'/'pT'/'pW'/'pH'/Ed editor"'
  34.       END
  35.  
  36.       port = 'DME'
  37.       IF ~SHOW('P', port) THEN DO
  38.          ADDRESS COMMAND
  39.            'Run >NIL:' cmd ' 'file' ' winpar
  40.            'WaitForPort' port
  41.            IF RC ~= 0 THEN RETURN 5
  42.       END
  43.       ELSE DO
  44.          ADDRESS VALUE port
  45.          'NEWFILE 'file
  46.       END
  47.    END
  48.    WHEN UPPER(ARG(1)) = 'SAVE' THEN DO
  49.       PARSE ARG , port
  50.  
  51.       IF SHOW('P', port) & ABBREV(port, 'DME') THEN DO
  52.          ADDRESS VALUE port
  53.          'SAVEOLD'
  54.       END
  55.    END
  56.    WHEN UPPER(ARG(1)) = 'CLOSE' THEN DO
  57.       PARSE ARG , port
  58.  
  59.       IF SHOW('P', port) & ABBREV(port, 'DME') THEN DO
  60.          ADDRESS VALUE port
  61.          'QUIT'
  62.       END
  63.    END
  64. END
  65. RETURN port
  66.